// export 和 export default 是ES6模块化规范
export const baseURL = "http://124.93.196.45:10193"; // 服务器根地址

/**
 * 登录
 */
export const requestLogin = (username, password) => {
	// 调用接口
	return uni.request({
		url: baseURL + '/prod-api/api/login',
		method: 'POST',
		data: {
			username: username,
			password: password
		}
	})
}

/**
 * 轮播列表
 */
export const requestBanner = () => {
	return uni
		.request({
			url: baseURL + "/prod-api/api/park/rotation/list",
			method: "GET",
			data: {
				type: 2,
			},
		})
}
/**
 * 新闻分类列表
 */
export const requestNewCategoryList = () => {
	return uni
		.request({
			url: baseURL + "/prod-api/press/category/list",
			method: "GET",
		})
}
/**
 * 新闻列表
 */
export const requestNewList = (id) => {
	return uni.request({
		url: baseURL + "/prod-api/press/press/list",
		method: "get",
		data: {
			type: id,
		},
	})
}

/**
 * 新闻详情
 */
export const requestNewsDetail = (id)=>{
	return uni.request({
		url: baseURL + "/prod-api/press/press/"+id,
		method:'GET'
	})
}